package com.zhaoxi.project.api.mall;

import com.zhaoxi.framework.web.BaseService;
import com.zhaoxi.framework.web.PageData;
import com.zhaoxi.project.sys.service.SlideshowService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 公告 信息操作处理
 *
 * @author zhaoxi
 */
@Tag(name = "系统商城接口")
@RestController
@RequestMapping("/api/mall")
public class MallController extends BaseService {
  @Autowired
  private SlideshowService slideshowService;

  @Operation(summary = "轮播图")
  @GetMapping("/slideshow/getList")
  public PageData getMallCategoryTree(Map map) {
    PageData pd = this.getPageData(map);
    if (pd.isEmpty("code")){
      return this.error("获取轮播图code不能为空！！！");
    }
    pd.remove("tenantId");
    List<PageData> list = slideshowService.getList(pd);
    return this.responses(list);
  }
}
